from datetime import time

from sqlalchemy import Column, Integer, String, DateTime, ForeignKey, Table
from sqlalchemy.orm import relationship
from sqlalchemy.orm.session import Session

from airflow.models import User
from airflow.models.base import Base
from airflow.models.idata_project_user import ProjectUser
from airflow.utils.session import provide_session


class File():

    file_name = None
    is_dir = None
    size = None
    last_modified = None
    path = None
    project = None


    def __init__(self,file_name,is_dir,size,last_modified,path , project):
        self.file_name = file_name
        self.is_dir = is_dir
        self.size = size
        self.last_modified = last_modified
        self.path = path
        self.project = project

    def to_json(self):
        if(self is None):
            return None
        data = {
            'file_name': self.file_name,
            'is_dir': self.is_dir,
            'size': self.size,
            'last_modified': self.last_modified ,
            'path': self.path,
            'project': self.project
        }
        return data
